#ifndef CONNECTION_H
#define CONNECTION_H

#include <QSqlDatabase>
#include <QSqlQuery>

static bool createConnection()
{
    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName(":memory:");
    db.open();
    
    QSqlQuery query;
    query.exec("create table gadwl(id int, subject int,fromTime int,"
     			"toTime int,place int, person int)");
    query.exec("create table subjects ( id int,subject varchar(50))");
    query.exec("create table places ( id int,place varchar(50))");
    query.exec("create table teachers ( id int,teacher varchar(50))");
    query.exec("create table times ( id int,time varchar(10) )");
    return true;
}

#endif
